Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD

Class com.pacist.diamonds.Knob

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Canvas
              |
              +--com.pacist.diamonds.DiamondCanvas
                    |
                    +--com.pacist.diamonds.Controller
                          |
                          +--com.pacist.diamonds.AngularController
                                |
                                +--com.pacist.diamonds.Knob

public class Knob
extends AngularController
A component implementing a rotating controller such as a knob or meter. It can be used for the display or entry of numeric values.

See Also:
Serialized Form

Fields inherited from class com.pacist.diamonds.Controller
canMeasure, listeners, maxValue, minValue, postOnMouseDown, postWhileDragging, showValue, value
 
Fields inherited from class com.pacist.diamonds.DiamondCanvas
tipText
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
Knob()
          Creates and initializes a Knob object.
 
Method Summary
void drawBGRect(java.awt.Graphics g, java.awt.Dimension size)
          Draws the background rectangle of the Knob.
void drawKnob(java.awt.Graphics g, java.awt.Rectangle displayRect)
          This method is called to draw the Knob on the screen.
void drawSpot(java.awt.Graphics g, java.awt.Rectangle displayRect, java.awt.Point p)
          Draws the spot indicating the current value of the Knob.
void drawTicks(java.awt.Graphics g, java.awt.Rectangle displayRect, java.awt.Point p)
          Draws the ticks around the edge of the Knob.
java.awt.Rectangle getDisplayRect(java.awt.Dimension size)
           
java.awt.Dimension minimumSize()
          Gets the mininimum size of the Knob.
void paint(java.awt.Graphics g)
          This method is called to repaint the Knob.
java.awt.Dimension preferredSize()
          Gets the preferred size of the Knob.
 
Methods inherited from class com.pacist.diamonds.AngularController
angleToValue, getCentre, getDisplayRect, getDisplayRect, paint, paintTick, pointToValue, scaleForY, scaleForY, valueToAngle
 
Methods inherited from class com.pacist.diamonds.Controller
addControllerListener, getMaxValue, getMinValue, getPostOnMouseDown, getShowValue, getValue, getValueString, isMaxAtBottom, mouseDragged, mousePressed, mouseReleased, notifyValueChange, pinValue, pointToValue, processMouseEvent, processMouseMotionEvent, removeControllerListener, setMaxAtBottom, setMaxValue, setMinValue, setPostOnMouseDown, setShowValue, setValue
 
Methods inherited from class com.pacist.diamonds.DiamondCanvas
getTipText, mouseEnter, mouseExit, processMouseEvent, setTipText
 
Methods inherited from class java.awt.Canvas
addNotify, paint
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getParent, getPeer, getPreferredSize, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paint, paramString, postEvent, preferredSize, prepareImage, prepareImage, printAll, print, processComponentEvent, processEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, update, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait
 

Constructor Detail

Knob

public Knob()
Creates and initializes a Knob object.
Method Detail

preferredSize

public java.awt.Dimension preferredSize()
Gets the preferred size of the Knob.
Returns:
Dimension - a dimension object indicating the knob's preferred size.
Overrides:
preferredSize in class java.awt.Component
See Also:
minimumSize, java.awt.LayoutManager

minimumSize

public java.awt.Dimension minimumSize()
Gets the mininimum size of the Knob.
Returns:
Dimension - a dimension object indicating the knob's minimum size.
Overrides:
minimumSize in class java.awt.Component
See Also:
getPreferredSize, java.awtLayoutManager

getDisplayRect

protected java.awt.Rectangle getDisplayRect(java.awt.Dimension size)
Overrides:
getDisplayRect in class AngularController

paint

public void paint(java.awt.Graphics g)
This method is called to repaint the Knob.
Parameters:
g - The graphics context to use for painting.
Overrides:
paint in class AngularController

drawKnob

protected void drawKnob(java.awt.Graphics g,
                        java.awt.Rectangle displayRect)
This method is called to draw the Knob on the screen.
Parameters:
g - the graphics context.
displayRect - the display rectangle.
See Also:
getDisplayRect()

drawBGRect

protected void drawBGRect(java.awt.Graphics g,
                          java.awt.Dimension size)
Draws the background rectangle of the Knob.
Parameters:
g - the graphics context.
size - the size of the rectangle to draw.

drawSpot

protected void drawSpot(java.awt.Graphics g,
                        java.awt.Rectangle displayRect,
                        java.awt.Point p)
Draws the spot indicating the current value of the Knob.
Parameters:
g - the graphics context.
displayRect - the display rectangle.
p - the offset for the position of the spot.
See Also:
getDisplayRect()

drawTicks

protected void drawTicks(java.awt.Graphics g,
                         java.awt.Rectangle displayRect,
                         java.awt.Point p)
Draws the ticks around the edge of the Knob. One indicating the minimum value allowed, the default value allowed, and the maximum value allowed.
Parameters:
g - the graphics context.
displayRect - the display rectangle.
p - the offset for the position of the ticks.
See Also:
getDisplayRect()

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD